import request from "../utils/request";

//获取所有服务类型
export const getAllServiceType = (data?:any)=>{
    // console.log(data);
    // return request({
    //     url:`/gen/servicetype?${data}`,
    //     method:'get',
    // })
    if(data){
        return request({
            url:`/gen/servicetype?name=${data.name}`,
            method:'get',
        })
    }else{
        return request({
            url:`/gen/servicetype`,
            method:'get',
        })
    }
}

//添加服务类型
export const addServiceType = (data:any)=>{
    return request({
        url:"/gen/servicetype",
        method:'post',
        data
    })
}

//删除服务类型
export const delServiceType = (data:any)=>{
    return request({
        url:`/gen/servicetype/${data}`,
        method:'delete',
    })
}


//修改服务类型
export const updateServiceType = (data:any)=>{
    return request({
        url:"/gen/servicetype",
        method:'put',
        data
    })
}